package com.tg.service.eventbus;

import com.google.common.collect.Lists;
import com.tg.service.utils.ContextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.*;

/**
 * Created by linzc on 2018/9/20.
 */

//@DependsOn({"LoginTaskEventHandler"})
//@Configuration
public class EventBusConfig {

//    @Autowired
//    private SendFailMailHandler handler;

    //    @Qualifier
//    @Bean
//    public EventBusAdapter init() {
//
//        EventBusAdapter busAdapter = new EventBusAdapter();
//        busAdapter.setEventBusListener(Lists.newArrayList(handler));
////        busAdapter.register(handler);
//        return busAdapter;
//    }

//    @Bean(name = "MqEventHandler")
//    @Primary
//
//    public MqEventHandler init2() {
//        String eventName = "Login";
//
////        TaskEventHandler handler1 = ContextUtil.getBean(eventName + TaskEventHandler.class.getSimpleName());
////        handler1.setBeanName(eventName);
////
////        String eventName2 = "Login";
////        TaskEventHandler handler2 = ContextUtil.getBean(eventName2 + TaskEventHandler.class.getSimpleName());
////        handler2.setBeanName(eventName2);
//
//        MqEventHandler mqEventHandler = new MqEventHandler();
////        mqEventHandler.setEventBusListener(Lists.newArrayList(handler1, handler2));
////        mqEventHandler.goon();
//
//        return mqEventHandler;
//    }


}
